package com.hc.demo.controller;

import com.hc.demo.dto.CalendarRequestDto;
import com.hc.demo.dto.ResultResponse;
import com.hc.demo.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CalendarController {
    @Autowired
    CalendarService calendarService;
    /**
     * 日期占位
     * 未来30天可预约高亮显示，剩余数量
     * @param calendarRequestDto
     * @return
     */
    @RequestMapping("/listCalendar")
    public ResultResponse listCalendar(@RequestBody CalendarRequestDto calendarRequestDto){

        // return calendarService.listCalendarWithRemainder(calendarRequestDto.getYear(),calendarRequestDto.getMonth(),calendarRequestDto.getHpId());
        return new ResultResponse(ResultResponse.SUCCESS_CODE,
                ResultResponse.SUCCESS_DESC,
                calendarService.listCalendarWithRemainder(calendarRequestDto.getYear(),
                        calendarRequestDto.getMonth(),calendarRequestDto.getHpId()));
    }
}
